package com.hh.myfish.controller;

import com.hh.myfish.anno.MyFish;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@RestController
public class FishController {
    @Resource
    private RestTemplate restTemplate;

    @GetMapping("/doRpc")
    @MyFish
    public String doRpc() {
        // 没有这个服务 状态开关
        String result = restTemplate.getForObject("http://localhost:8989/abc", String.class);
        System.out.println("result = " + result);
        return result;
    }
}
